<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="timo-detail-page">
<!--        <div class="timo-detail-title">GIT分支清除操作</div>-->
        <form th:action="@{/app/info/branch/delete}">
            <div class="layui-form-item">
                <label >请选择项目</label>
                <div >
                    <div th:replace="/common/fragment :: selectTag('appId',${apps},${appId},'id','display_name','')"></div>
                </div>
            </div>
            <div class="layui-form-item">
                <label style="color: blue;font-weight: bold;">所有分支信息</label>
                <div id="branchCheckboxs">

                </div>
            </div>
            <div class="layui-form-item timo-finally" style="margin-top: 2em">
                <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 确认</button>
                <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
            </div>
        </form>
    </div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
<script>
    $(document).ready(function () {
        $('#appId').change(function () {
           loadBranchCheckboxs();
        });
    });

    function loadBranchCheckboxs(){
        let appId = $('#appId').val();
        if(appId){
            $('#branchCheckboxs').html('正在加载...')
            //改成异步加载方式
            $.post('/app/info/branch/checkboxs',{"appId":appId},function (html) {
                $('#branchCheckboxs').html(html)
            });
        }
    }
</script>
</body>
</html>